/*
 * Copyright 2008 Andrej Herich
 * 
 * http://azetclient.yw.sk/
 * http://azetclient.googlecode.com/
 * 
 * This file is part of AzetClient.
 * 
 * AzetClient is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * AzetClient is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with AzetClient.  If not, see <http://www.gnu.org/licenses/>.
 */

package sk.yw.azetclient.azet;

import java.util.Date;
import sk.yw.azetclient.model.AbstractMessageBean;
import sk.yw.azetclient.model.Message;
import sk.yw.azetclient.model.MessageThread;

/**
 *
 * @author error216
 */
public class AzetMessageBean extends AbstractMessageBean {
    
    private String sign;
    private Date timeOfPrevious;
    private String textOfPrevious;
    private String lastFragment;
    
    public AzetMessageBean() {
        super();
    }
    
    public AzetMessageBean(Message message) {
        super(message);
        
        if (message instanceof AzetMessage) {
            AzetMessage aMessage = (AzetMessage) message;
            sign = aMessage.getSign();
            timeOfPrevious = aMessage.getTimeOfPrevious();
            textOfPrevious = aMessage.getTextOfPrevious();
            lastFragment = aMessage.getLastFragment();
        }
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    public Date getTimeOfPrevious() {
        return timeOfPrevious;
    }

    public void setTimeOfPrevious(Date timeOfPrevious) {
        this.timeOfPrevious = timeOfPrevious;
    }

    public String getTextOfPrevious() {
        return textOfPrevious;
    }

    public void setTextOfPrevious(String textOfPrevious) {
        this.textOfPrevious = textOfPrevious;
    }

    public String getLastFragment() {
        return lastFragment;
    }

    public void setLastFragment(String lastFragment) {
        this.lastFragment = lastFragment;
    }
    
    public AzetMessage createImmutable(MessageThread thread) {
        return new AzetMessage(this, thread);
    }

}
